package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.CollectRule;
import com.ruoyi.system.mapper.CollectRuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DatabaseInfoMapper;
import com.ruoyi.system.domain.DatabaseInfo;
import com.ruoyi.system.service.IDatabaseInfoService;

/**
 * 业务数据库Service业务层处理
 *
 * @author chenming
 * @date 2024-10-16
 */
@Service
public class DatabaseInfoServiceImpl extends ServiceImpl<DatabaseInfoMapper, DatabaseInfo> implements IDatabaseInfoService
{
    @Autowired
    private DatabaseInfoMapper databaseInfoMapper;

    /**
     * 查询业务数据库
     *
     * @param databaseId 业务数据库主键
     * @return 业务数据库
     */
    @Override
    public DatabaseInfo selectDatabaseInfoByDatabaseId(Long databaseId)
    {
        return databaseInfoMapper.selectDatabaseInfoByDatabaseId(databaseId);
    }

    /**
     * 查询业务数据库列表
     *
     * @param databaseInfo 业务数据库
     * @return 业务数据库
     */
    @Override
    public List<DatabaseInfo> selectDatabaseInfoList(DatabaseInfo databaseInfo)
    {
        return databaseInfoMapper.selectDatabaseInfoList(databaseInfo);
    }

    /**
     * 新增业务数据库
     *
     * @param databaseInfo 业务数据库
     * @return 结果
     */
    @Override
    public int insertDatabaseInfo(DatabaseInfo databaseInfo)
    {
        return databaseInfoMapper.insertDatabaseInfo(databaseInfo);
    }

    /**
     * 修改业务数据库
     *
     * @param databaseInfo 业务数据库
     * @return 结果
     */
    @Override
    public int updateDatabaseInfo(DatabaseInfo databaseInfo)
    {
        return databaseInfoMapper.updateDatabaseInfo(databaseInfo);
    }

    /**
     * 批量删除业务数据库
     *
     * @param databaseIds 需要删除的业务数据库主键
     * @return 结果
     */
    @Override
    public int deleteDatabaseInfoByDatabaseIds(Long[] databaseIds)
    {
        return databaseInfoMapper.deleteDatabaseInfoByDatabaseIds(databaseIds);
    }

    /**
     * 删除业务数据库信息
     *
     * @param databaseId 业务数据库主键
     * @return 结果
     */
    @Override
    public int deleteDatabaseInfoByDatabaseId(Long databaseId)
    {
        return databaseInfoMapper.deleteDatabaseInfoByDatabaseId(databaseId);
    }
}
